﻿@model WebCommit.Common.Models.LoginRequest
		   
@{WebCommit.Common.Entitys.UserEntity user = Session["LoginUser"] as WebCommit.Common.Entitys.UserEntity;}
@if (user != null)
{ 
	@user.UserName 
	<span>&nbsp;</span>
	@Html.ActionLink("退 出", "Logout", "UserVis", null, new { Title = "点击退出" });
}
else
{
	<script type="text/javascript">
		function ShowLoginDiv() {
			var offset = $("#btnLogin").offset();
			var loginDiv = $("#LoginDiv");
			if (loginDiv.css("visibility") == "visible")
				loginDiv.css("visibility", "hidden");
			else {
				loginDiv.offset({ left: offset.left - 30, top: offset.top + 20 });
				loginDiv.css("visibility", "visible");
			}
		}
	</script>
	<a href="javascript:void(0)" onclick="ShowLoginDiv()" id="btnLogin"  title="点击登录">登 录</a><span>&nbsp;</span>
	@Html.ActionLink("注 册", "Register", "UserMgr", null, new { Title = "点击注册" })

}
<span>&nbsp;&nbsp;</span><a href="javascript:void(0);" onclick="AddFav(this,'我要评论','@(WebCommit.Common.Helpers.Utility.GetCurrentSiteUrl() + Url.Action("Title", "Commit"))');">收藏</a>
@if (user == null)
{
	using (Html.BeginForm("Login", "UserVis", FormMethod.Post, new { style = "margin:0" }))
	{
		@Html.AntiForgeryToken()
	<div style="visibility:hidden;position:absolute;text-align:left; background-color:White;border:1px solid #cccccc" id="LoginDiv">
	<div>
		@Html.TextBoxFor(m => m.UserName, new { tip = "这里输入用户名" })</div>
	<div>	<input ispwdtip="true" type="text" tip="这里输入密码" />
	@Html.PasswordFor(m => m.Password, new { style = "display:none", tip = "密码" })</div>
		<div>
		@Html.CheckBoxFor(m => m.AutoLogin)<span>下次自动登录</span></div>
		@Html.Hidden("RedirctUrl", (Model == null || string.IsNullOrEmpty(Model.RedirctUrl)) ? this.Request.RawUrl : Model.RedirctUrl)
	<div>	<input type="submit" value="登录" /></div>
	</div>
	}
}